﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Xml;
using System.Data;

using Gift.WebApp;

public partial class cn_UserControl_ipush : System.Web.UI.UserControl
{
  // Fields
    protected string ipushXmlPath = "/cn/xml/ipush_set.xml";
    protected string xmlPath = "/cn/xml/home.xml";

    // Methods
    protected StringBuilder IpushBind()
    {
        StringBuilder builder = new StringBuilder();
        try
        {
            XmlElement element3;
            XmlDocument document = new XmlDocument();
            document.Load(base.Server.MapPath(this.xmlPath));
            XmlElement element = (XmlElement) document.SelectSingleNode("home_ad/ipush");
            if (!(element.GetAttribute("enable") == "true"))
            {
                return builder;
            }
            XmlDocument document2 = new XmlDocument();
            document2.Load(base.Server.MapPath(this.ipushXmlPath));
            XmlNodeList childNodes = document2.SelectSingleNode("set").ChildNodes;
            builder.AppendLine("<script type=\"text/javascript\">function mbsgg(url, chance) { this.url = url; this.chance = chance;} var da, dalen, chance_limit, random_sel_num; da = new Array(); ");
            for (int i = 0; i < childNodes.Count; i++)
            {
                XmlElement element2 = childNodes[i] as XmlElement;
                int num2 = Convert.ToInt32(element2.GetAttribute("chance"));
                builder.AppendLine(string.Concat(new object[] { "da[", i, "] = new mbsgg(\"", element2.GetAttribute("title"), "\", ", num2, ");" }));
            }
            builder.AppendLine("var dalen = da.length; </script>");
            builder.AppendLine("<script language=\"javascript\" src=\"" + new TemplateLoad().TemplateCssLoad() + "ad/jquery.autocomplete.mini.js\" type=\"text/javascript\"></script>");
            builder.AppendLine("<script language=\"javascript\" src=\"" + new TemplateLoad().TemplateCssLoad() + "ad/jquery.lazyload.mini.js\" type=\"text/javascript\"></script>");
            builder.AppendLine("<script language=\"javascript\" src=\"" + new TemplateLoad().TemplateCssLoad() + "ad/ad.js\" type=\"text/javascript\"></script>");
            builder.AppendLine("<div style=\"z-index: 9999; height: 0; right: 0; bottom: 0; overflow: hidden; position: fixed;_position: absolute; _margin-top: expression(document.documentElement.clientHeight-this.style.pixelHeight+document.documentElement.scrollTop);\" title=\"粉色\" id=\"floatad-winpop1\">");
            builder.AppendLine("<span onclick=\"tips_pop()\" class=\"close1\"><img height=\"13\" width=\"13\" src=\"" + new TemplateLoad().TemplateCssLoad() + "ad/images/20100803_03_12.jpg\" alt=\"关闭\" title=\"关闭\" /></span>");
            builder.AppendLine("<a class=\"tit\" href=\"#\"></a>");
            builder.AppendLine("<div class=\"floatad-floatBorder1\">");
            builder.AppendLine("<div class=\"floatad-setTab-area1\">");
            builder.AppendLine("<div class=\"floatad-setTabCon1\">");
            XmlNodeList list2 = element.ChildNodes;
            int num3 = 1;
            foreach (XmlNode node in list2)
            {
                element3 = (XmlElement) node;
                builder.AppendLine("<div id=\"con_one_" + num3 + "\">");
                builder.AppendLine("<a href=\"" + element3.GetAttribute("url") + "\" target=\"_blank\" rel=\"nofollow\"><img src=\"" + element3.GetAttribute("src") + "\" alt=\"" + element3.GetAttribute("alt") + "\" /></a>");
                builder.AppendLine("</div>");
                num3++;
            }
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div class=\"floatad-setTabMenu1\">");
            builder.AppendLine("<ul>");
            num3 = 1;
            foreach (XmlNode node in list2)
            {
                element3 = (XmlElement) node;
                builder.AppendLine(string.Concat(new object[] { "<li style=\"margin-left: 3px;\" onmouseover=\"setTab('one',", num3, ",", Convert.ToInt32(element.GetAttribute("count")), ")\" class=\"hover\" id=\"one", num3, "\"><a href=\"", element3.GetAttribute("url"), "\" target=\"_blank\" rel=\"nofollow\">", element3.GetAttribute("alt"), "</a></li>" }));
                num3++;
            }
            builder.AppendLine("</ul>");
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div id=\"floatad-winpop2\" title=\"黑色\" style=\"z-index: 9999; position: fixed; _position: absolute;bottom: 0px; background: #101010; height: 0px; overflow: hidden; right: 0px; margin-top: 0px; _margin-top: expression(document.documentElement.clientHeight-this.style.pixelHeight+document.documentElement.scrollTop);\">");
            builder.AppendLine("<span class=\"close2\" onclick=\"tips_pop()\"><img width=\"13\" height=\"13\" align=\"absMiddle\" title=\"关闭\" alt=\"关闭\" src=\"" + new TemplateLoad().TemplateCssLoad() + "ad/images/20100803_03_12.jpg\" /></span>");
            builder.AppendLine("<div class=\"floatad-floatBorder2\">");
            builder.AppendLine("<div class=\"adtitle\">" + (childNodes[1] as XmlElement).GetAttribute("ad_title") + "</div>");
            builder.AppendLine("<div class=\"floatad-setTab-area2\">");
            builder.AppendLine("<div class=\"floatad-setTabMenu2\">");
            builder.AppendLine("<ul>");
            num3 = 1;
            foreach (XmlNode node in list2)
            {
                element3 = (XmlElement) node;
                builder.AppendLine(string.Concat(new object[] { "<li id=\"two", num3, "\" class=\"hover\" onmouseover=\"setTab('two',", num3, ",", Convert.ToInt32(element.GetAttribute("count")), ")\"><a rel=\"nofollow\" target=\"_blank\" href=\"", element3.GetAttribute("url"), "\">", element3.GetAttribute("alt"), "</a></li>" }));
                num3++;
            }
            builder.AppendLine("</ul>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div class=\"floatad-setTabCon2\">");
            num3 = 1;
            foreach (XmlNode node in list2)
            {
                element3 = (XmlElement) node;
                builder.AppendLine("<div id=\"con_two_" + num3 + "\">");
                builder.AppendLine("<a href=\"" + element3.GetAttribute("url") + "\" target=\"_blank\" rel=\"nofollow\"><img src=\"" + element3.GetAttribute("src") + "\" alt=\"" + element3.GetAttribute("alt") + "\" /></a>");
                builder.AppendLine("</div>");
                num3++;
            }
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div class=\"floatad_line\">&nbsp;</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div style=\"z-index: 9999; height: 0; right: 0; bottom: 0; overflow: hidden; position: fixed;_position: absolute; _margin-top: expression(document.documentElement.clientHeight-this.style.pixelHeight+document.documentElement.scrollTop);\" title=\"红色经典\" id=\"floatad-winpop3\">");
            builder.AppendLine("<span onclick=\"tips_pop()\" class=\"close3\"><img height=\"13\" width=\"13\" src=\"" + new TemplateLoad().TemplateCssLoad() + "ad/images/20100803_03_12.jpg\" alt=\"关闭\" title=\"关闭\" /></span>");
            builder.AppendLine("<a class=\"tit\" target=\"_blank\" href=\"#\">&nbsp;</a>");
            builder.AppendLine("<div class=\"floatad-floatBorder3\">");
            builder.AppendLine("<div class=\"floatad-setTab-area3\">");
            builder.AppendLine("<div class=\"floatad-setTabCon3\">");
            num3 = 1;
            foreach (XmlNode node in list2)
            {
                element3 = (XmlElement) node;
                builder.AppendLine("<div id=\"con_three_" + num3 + "\">");
                builder.AppendLine("<a href=\"" + element3.GetAttribute("url") + "\" target=\"_blank\" rel=\"nofollow\"><img height=\"202\" width=\"324\" src=\"" + element3.GetAttribute("src") + "\" alt=\"" + element3.GetAttribute("alt") + "\" /></a>");
                builder.AppendLine("</div>");
                num3++;
            }
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div class=\"floatad-setTabMenu3\">");
            builder.AppendLine("<ul>");
            num3 = 1;
            foreach (XmlNode node in list2)
            {
                element3 = (XmlElement) node;
                builder.AppendLine(string.Concat(new object[] { "<li style=\"margin-left: 3px;\" onmouseover=\"setTab('three',", num3, ",", Convert.ToInt32(element.GetAttribute("count")), ")\" class=\"hover\" id=\"three", num3, "\"><a href=\"", element3.GetAttribute("url"), "\" target=\"_blank\" rel=\"nofollow\">", element3.GetAttribute("alt"), "</a></li>" }));
                num3++;
            }
            builder.AppendLine("</ul>");
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div style=\"z-index: 9999; height: 0; right: 0; bottom: 0; overflow: hidden; position: fixed;_position: absolute; _margin-top: expression(document.documentElement.clientHeight-this.style.pixelHeight+document.documentElement.scrollTop);\" title=\"蓝色\" id=\"floatad-winpop4\">");
            builder.AppendLine("<span class=\"close4\" onclick=\"tips_pop()\"><img height=\"13\" width=\"13\" src=\"" + new TemplateLoad().TemplateCssLoad() + "ad/images/20100803_03_12.jpg\" alt=\"关闭\" /></span>");
            builder.AppendLine("<div class=\"floatad-floatBorder4\">");
            builder.AppendLine("<div class=\"floatad-setTab-area4\">");
            builder.AppendLine("<div class=\"floatad-setTabMenu4\">");
            builder.AppendLine("<ul>");
            num3 = 1;
            foreach (XmlNode node in list2)
            {
                element3 = (XmlElement) node;
                builder.AppendLine(string.Concat(new object[] { "<li onmouseover=\"setTab('four',", num3, ",", Convert.ToInt32(element.GetAttribute("count")), ")\" class=\"hover\" id=\"four", num3, "\"><a href=\"", element3.GetAttribute("url"), "\" target=\"_blank\" rel=\"nofollow\">", element3.GetAttribute("alt"), "</a></li>" }));
                num3++;
            }
            builder.AppendLine("</ul>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div class=\"floatad-setTabCon4\">");
            builder.AppendLine("<div class=\"imgtop\"></div>");
            num3 = 1;
            foreach (XmlNode node in list2)
            {
                element3 = (XmlElement) node;
                builder.AppendLine("<div id=\"con_four_" + num3 + "\">");
                builder.AppendLine("<a href=\"" + element3.GetAttribute("url") + "\" target=\"_blank\" rel=\"nofollow\"><img height=\"202\" width=\"324\" src=\"" + element3.GetAttribute("src") + "\" alt=\"" + element3.GetAttribute("alt") + "\" /></a>");
                builder.AppendLine("</div>");
                num3++;
            }
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div style=\"z-index:9999;height:0;right:0;bottom:0;overflow:hidden;position:fixed;_position:absolute;_margin-top:expression(document.documentElement.clientHeight-this.style.pixelHeight+document.documentElement.scrollTop);\" title=\"灰色\" id=\"floatad-winpop5\">");
            builder.AppendLine("<span class=\"close5\" onclick=\"tips_pop()\"><img height=\"13\" width=\"13\" src=\"" + new TemplateLoad().TemplateCssLoad() + "ad/images/20100803_03_12.jpg\" alt=\"关闭\" title=\"关闭\" /></span>");
            builder.AppendLine("<div class=\"floatad-floatBorder5\">");
            builder.AppendLine("<div class=\"cl_style\">" + (childNodes[4] as XmlElement).GetAttribute("ad_title") + "</div>");
            builder.AppendLine("<div class=\"floatad-setTabMenu5\">");
            builder.AppendLine("<ul>");
            num3 = 1;
            foreach (XmlNode node in list2)
            {
                element3 = (XmlElement) node;
                builder.AppendLine(string.Concat(new object[] { "<li onmouseover=\"setTab('five',", num3, ",", Convert.ToInt32(element.GetAttribute("count")), ")\" class=\"hover\" id=\"five", num3, "\"><a href=\"", element3.GetAttribute("url"), "\" target=\"_blank\" rel=\"nofollow\">", element3.GetAttribute("alt"), "</a></li>" }));
                num3++;
            }
            builder.AppendLine("</ul>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div class=\"floatad-setTab-area5\">");
            builder.AppendLine("<div class=\"floatad-setTabCon5\">");
            num3 = 1;
            foreach (XmlNode node in list2)
            {
                element3 = (XmlElement) node;
                builder.AppendLine("<div id=\"con_five_" + num3 + "\">");
                builder.AppendLine("<a href=\"" + element3.GetAttribute("url") + "\" target=\"_blank\" rel=\"nofollow\"><img height=\"228\" width=\"401\" src=\"" + element3.GetAttribute("src") + "\" alt=\"" + element3.GetAttribute("alt") + "\" /></a>");
                builder.AppendLine("</div>");
                num3++;
            }
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div style=\"z-index: 9999; height: 0; right: 0; bottom: 0; overflow: hidden; position: fixed;_position: absolute; _margin-top: expression(document.documentElement.clientHeight-this.style.pixelHeight+document.documentElement.scrollTop);\" title=\"绿色\" id=\"floatad-winpop6\">");
            builder.AppendLine("<span class=\"close6\" onclick=\"tips_pop()\"><img height=\"13\" width=\"13\" src=\"" + new TemplateLoad().TemplateCssLoad() + "ad/images/20100803_03_12.jpg\" alt=\"关闭\" title=\"关闭\" /></span>");
            builder.AppendLine("<div class=\"floatad-floatBorder6\">");
            builder.AppendLine("<div class=\"cl_style6\">" + (childNodes[5] as XmlElement).GetAttribute("ad_title") + "</div>");
            builder.AppendLine("<div class=\"floatad-setTabMenu6\">");
            builder.AppendLine("<ul>");
            num3 = 1;
            foreach (XmlNode node in list2)
            {
                element3 = (XmlElement) node;
                builder.AppendLine(string.Concat(new object[] { "<li onmouseover=\"setTab('six',", num3, ",", Convert.ToInt32(element.GetAttribute("count")), ")\" class=\"hover\" id=\"six", num3, "\"><a href=\"", element3.GetAttribute("url"), "\" target=\"_blank\" rel=\"nofollow\">", element3.GetAttribute("alt"), "</a></li>" }));
                num3++;
            }
            builder.AppendLine("</ul>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div class=\"floatad-setTab-area6\">");
            builder.AppendLine("<div class=\"floatad-setTabCon6\">");
            num3 = 1;
            foreach (XmlNode node in list2)
            {
                element3 = (XmlElement) node;
                builder.AppendLine("<div id=\"con_six_" + num3 + "\">");
                builder.AppendLine("<a href=\"" + element3.GetAttribute("url") + "\" target=\"_blank\" rel=\"nofollow\"><img src=\"" + element3.GetAttribute("src") + "\" alt=\"" + element3.GetAttribute("alt") + "\" /></a>");
                builder.AppendLine("</div>");
                num3++;
            }
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div class=\"floatad_line\">&nbsp;</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div style=\"z-index: 9999; height: 0; right: 0; bottom: 0; overflow: hidden; position: fixed;_position: absolute; _margin-top: expression(document.documentElement.clientHeight-this.style.pixelHeight+document.documentElement.scrollTop);\" title=\"黑色经典\" id=\"floatad-winpop7\">");
            builder.AppendLine("<span class=\"close5\" onclick=\"tips_pop()\"><img height=\"13\" width=\"13\" src=\"" + new TemplateLoad().TemplateCssLoad() + "ad/images/20100803_03_12.jpg\" alt=\"关闭\" title=\"关闭\" /></span>");
            builder.AppendLine("<div class=\"floatad-floatBorder7\">");
            builder.AppendLine("<div class=\"cl_style7\">" + (childNodes[6] as XmlElement).GetAttribute("ad_title") + "</div>");
            builder.AppendLine("<div class=\"floatad-setTabMenu7\">");
            builder.AppendLine("<ul>");
            num3 = 1;
            foreach (XmlNode node in list2)
            {
                element3 = (XmlElement) node;
                builder.AppendLine(string.Concat(new object[] { "<li onmouseover=\"setTab('seven',", num3, ",", Convert.ToInt32(element.GetAttribute("count")), ")\" class=\"hover\" id=\"seven", num3, "\"><a href=\"", element3.GetAttribute("url"), "\" target=\"_blank\">", element3.GetAttribute("alt"), "</a></li>" }));
                num3++;
            }
            builder.AppendLine("</ul>");
            builder.AppendLine("<a href=\"#\" target=\"_blank\" class=\"i2i_link\">ing2ing</a></div>");
            builder.AppendLine("<div class=\"floatad-setTab-area7\">");
            builder.AppendLine("<div class=\"floatad-setTabCon7\">");
            num3 = 1;
            foreach (XmlNode node in list2)
            {
                element3 = (XmlElement) node;
                builder.AppendLine("<div id=\"con_seven_" + num3 + "\">");
                builder.AppendLine("<a href=\"#\" target=\"_blank\"><img height=\"216\" width=\"402\" src=\"" + element3.GetAttribute("src") + "\" alt=\"" + element3.GetAttribute("alt") + "\" /></a>");
                builder.AppendLine("</div>");
                num3++;
            }
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
            builder.AppendLine("<div class=\"floatad_line\"></div>");
            builder.AppendLine("</div>");
            builder.AppendLine("</div>");
        }
        catch
        {
        }
        return builder;
    }

    protected void Page_Load(object sender, EventArgs e)
    {
    }
}
